#ifndef _TABCTRLEX_H__
#define  _TABCTRLEX_H__

#pragma once


// CTabCtrlEx

class CTabCtrlEx : public CTabCtrl
{
	DECLARE_DYNAMIC(CTabCtrlEx)

public:
	CTabCtrlEx();
	virtual ~CTabCtrlEx();

protected:
	enum
	{
		ETC_FLAT = 1, 
		ETC_COLOR = 2, // draw tabs with color
		ETC_SELECTION = 4, // highlight the selected tab
		ETC_GRADIENT = 8, // draw colors with a gradient
		ETC_BACKTABS = 16,
	};
	DWORD s_dwCustomLook;
	CFont	m_SelFont;
	CFont	m_UnselFont;
	int		 m_nCurrentTabIndex;
	COLORREF	m_crUnselColor;
	COLORREF m_crBack;
	COLORREF m_crSelTTColor,m_crUnselTTColor;
	COLORREF GetTabTextColor(BOOL bSelected= FALSE);
	void SetColours(COLORREF bSelColour, COLORREF bUnselColour);
	COLORREF GetBgColor(void);
	DECLARE_MESSAGE_MAP()
	virtual void PreSubclassWindow();
	void DrawItemBorder(LPDRAWITEMSTRUCT lpdis);
	void DrawItem(LPDRAWITEMSTRUCT lpdis);
	void DrawMainBorder(LPDRAWITEMSTRUCT lpdis);
	COLORREF GetTabColor(BOOL bSelected= FALSE);
public:
	void SetTabTextColor(COLORREF clrSel,COLORREF clrunSel);
	void SetCustomStyle(DWORD dwStyle);
	void EnableCustomLook(BOOL bEnable, DWORD dwStyle);
	void SetBgColor(COLORREF clr);
	void SetTabColor(COLORREF clrSel,COLORREF clrunSel);
	void SetFonts(CFont* pSelFont, CFont* pUnselFont);
	void SetFonts(int nSelWeight=FW_SEMIBOLD, BOOL bSelItalic=FALSE,   BOOL bSelUnderline=FALSE,int nUnselWeight=FW_MEDIUM, BOOL bUnselItalic=FALSE, BOOL bUnselUnderline=FALSE);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
};
#endif